<template>
	<public-view navType="other" navTitle="账户与安全">
		<view class="content flex f-d-c a-i-c">
			<view class="setting-item w-100 flex a-i-c" @click="goTo({url:'myBankCard'})">
				<view class="right flex f-d-c">
					<view class="title f-s-30 color-333 f-w-b">
						银行卡
					</view>
				</view>
			</view>
			<view class="setting-item w-100 flex a-i-c" @click="goTo({url:'changePayPassword'})">
				<view class="right flex a-i-c j-c-b w-100">
					<view class="title f-s-30 color-333 f-w-b">
						支付密码
					</view>
					<view class="color-999 f-s-24">
						{{userInfo.pay_pass?'已设置':'未设置'}}
					</view>
				</view>
			</view>
			<view class="setting-item w-100 flex a-i-c" @click="unInstallUser">
				<view class="right flex a-i-c j-c-b w-100">
					<view class="title f-s-30 color-333 f-w-b">
						注销账户
					</view>
					<view class="color-999 f-s-24">
						<!-- {{userInfo.pay_pass?'已设置':'未设置'}} -->
					</view>
				</view>
			</view>
		</view>
	</public-view>
</template>

<script>
	import bottomBtn from "@/components/myComponents/bottomBtn.vue"
	import {goTo} from "@/nav.js"
	import {mapGetters} from "vuex"
	export default {
		components:{
			"bottom-btn":bottomBtn
		},
		computed:{
			...mapGetters(["userInfo"])
		},
		data() {
			return {
				
			};
		},
		methods:{
			goTo,
			unInstallUser(){
				let that = this
				that.util.getRequest({
					url:"v1/user/logout"
				}).then(res=>{
					console.log(res)
					uni.showToast({
						title:res.msg,
						duration:2500
					})
					let timeout = setTimeout(()=>{
						that.$getUser()
					},2500)
				}).catch(e=>{
					uni.showToast({
						title:"操作失败",
						icon:"none"
					})
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.setting-item{
		padding: 40upx 56upx;
		background: #FFFFFF;
		border-radius: 20upx;
		margin-bottom: 32upx;
		.right{
			.title{
				line-height: 42upx;
			}
			.m-b-8{
				margin-bottom: 8upx;
			}
		}
		.left{
			width: 80upx;
			height: 80upx;
			margin-right: 20upx;
			.icon{
				width: 32upx;
				height: 32upx;
			}
		}
	}
	.content{
		width: 750upx;
		padding: 42upx 30upx;
	}
</style>
